package com.app.abby.perfectweather.util;

import android.content.Context;

import com.amap.api.services.geocoder.GeocodeQuery;
import com.amap.api.services.geocoder.GeocodeSearch;

public class MapUtils {
    private static MapUtils instance;
    public static synchronized MapUtils getInstance() {
        if (instance == null) {
            instance = new MapUtils();
        }
        return instance;
    }
    public void city2location(Context context, String city, GeocodeSearch.OnGeocodeSearchListener onGeocodeSearchListener){
        GeocodeSearch geocodeSearch = new GeocodeSearch(context);
        geocodeSearch.setOnGeocodeSearchListener(onGeocodeSearchListener);
        GeocodeQuery query = new GeocodeQuery(city, null);
        geocodeSearch.getFromLocationNameAsyn(query);
    }
}
